<!DOCTYPE html>
<html>

<head>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
    <title>购物车</title>
    <script type="text/javascript" src="./js/routerJump.js"></script>
</head>

<body>
    <div class="container">
        <div class="head_guide_two">
            <div class="goBack_two">
                <img src="./Images/back.png">
            </div>
            <div class="title_two">购物车</div>
            <div class="empty"></div>
        </div>
        <div class="address">
            <div class="address_l">
                <img src="./Images/location.png">
                <span>天津市津南区</span>
            </div>
            <div class="address_r">
                <span>编辑</span>
            </div>
        </div>
        <div class="numberGoods">
            <span>全部(2)</span>
            <span>跨店满减(0)</span>
        </div>
        <div class="eve_shopping">
            <div class="eve_shopping_in">
                <div class="eve_shopping_in_one">
                    <div class="eve_shopping_in_one_business">
                        <input id="color_input_organ_one" type="checkbox" class="inputCheck">
                        <label for="color_input_organ_one" class="color_input_organ_lable"></label>
                    </div>
                    <div class="eve_shopping_in_one_business_title">
                        <img src="./Images/sign.png">
                        <span>小米官方商城</span>
                        <span>&gt;</span>
                    </div>
                </div>
                <div class="eve_shopping_in_two">
                    <div class="eve_shopping_in_two_img">
                        <img
                            src="https://cdn.cnbj1.fds.api.mi-img.com/nr-pub/202207011841_084ed41d67f248677914605b73faf582.png?thumb=1&w=200&h=200&f=webp&q=90">
                    </div>
                    <div class="eve_shopping_in_two_introduce">
                        <div class="eve_shopping_in_two_introduce_one">
                            &nbsp;小米12S 骁龙8+处理器 徕卡光学镜头 疾速影像 120Hz高刷 67W快充
                        </div>
                        <div class="eve_shopping_in_two_introduce_three">
                            <button>白色，8GB+256GB，选服务&gt;</button>
                        </div>
                        <div class="eve_shopping_in_two_introduce_two">
                            &nbsp;&nbsp;秒杀中，10月31日结束
                        </div>
                        <div class="eve_shopping_in_two_introduce_three_calucate" ident="0">
                            <div>
                                <div>￥</div>
                                <div>3999.00</div>
                            </div>
                            <div class="calucate_rewrite">
                                <div class="calucate_rewrite_one">
                                    <div class="price_delete">
                                        <img src="./Images/delete.png">
                                    </div>
                                </div>
                                <div class="calucate_rewrite_two">
                                    <input type="text" class="price_input" value="1">
                                </div>
                                <div class="calucate_rewrite_three">
                                    <div class="price_add">
                                        <img src="./Images/add.png">
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="eve_shopping">
            <div class="eve_shopping_in">
                <div class="eve_shopping_in_one">
                    <div class="eve_shopping_in_one_business">
                        <input id="color_input_organ_two" type="checkbox" class="inputCheck">
                        <label for="color_input_organ_two" class="color_input_organ_lable"></label>
                    </div>
                    <div class="eve_shopping_in_one_business_title">
                        <img src="./Images/jingdong.png">
                        <span>京东自营</span>
                        <span>&gt;</span>
                    </div>
                </div>
                <div class="eve_shopping_in_two">
                    <div class="eve_shopping_in_two_img">
                        <img src="./Images/shopping.png">
                    </div>
                    <div class="eve_shopping_in_two_introduce">
                        <div class="eve_shopping_in_two_introduce_one">
                            &nbsp;小米手环7\\手环7nfc智能手环运动手环血氧心率监测全面屏长续航 标准版
                        </div>
                        <div class="eve_shopping_in_two_introduce_three">
                            <button>离线支付，多种NFC&gt;</button>
                        </div>
                        <div class="eve_shopping_in_two_introduce_two">
                            &nbsp;&nbsp;秒杀中，11月11日结束
                        </div>
                        <div class="eve_shopping_in_two_introduce_three_calucate" ident="1">
                            <div>
                                <div>￥</div>
                                <div>1837.00</div>
                            </div>
                            <div class="calucate_rewrite">
                                <div class="calucate_rewrite_one">
                                    <div class="price_delete">
                                        <img src="./Images/delete.png">

                                    </div>
                                </div>
                                <div class="calucate_rewrite_two">
                                    <input type="text" class="price_input" value="1">
                                </div>
                                <div class="calucate_rewrite_three">
                                    <div class="price_add">
                                        <img src="./Images/add.png">
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="introduce">
            <div class="introduce_center">
                <div class="introduce_center_title">猜你喜欢</div>
            </div>
            <div class="introduce_box">
                <div class="introduce_box_in">
                    <img src="https://cdn.cnbj0.fds.api.mi-img.com/b2c-shopapi-pms/pms_1660187405.88555521.jpg">
                    <div class="introduce_box_in_first">

                        Xiaomi MIX Fold 2

                    </div>
                    <div class="introduce_box_in_second">
                        超轻薄折叠机身设计，小米自研微水滴形态转轴
                    </div>
                    <div class="introduce_box_in_thrid">
                        ￥8999
                    </div>
                </div>
                <div class="introduce_box_in">
                    <img src="https://cdn.cnbj0.fds.api.mi-img.com/b2c-shopapi-pms/pms_1632824968.20185994.png">
                    <div class="introduce_box_in_first">

                        Xiaomi真无线降噪耳机3

                    </div>
                    <div class="introduce_box_in_second">
                        40dB宽频主动降噪 | HiFi高保真音质 | HRTF专业调音
                    </div>
                    <div class="introduce_box_in_thrid">
                        ￥319
                    </div>
                </div>
                <div class="introduce_box_in">
                    <img src="https://cdn.cnbj0.fds.api.mi-img.com/b2c-shopapi-pms/pms_1640677355.02633044.png">
                    <div class="introduce_box_in_first">
                        XIAOMI Wwtch Color 2
                    </div>
                    <div class="introduce_box_in_second">
                        时刻出色，要你好看
                    </div>
                    <div class="introduce_box_in_thrid">
                        ￥2000
                    </div>
                </div>
                <div class="introduce_box_in">
                    <img src="https://cdn.cnbj0.fds.api.mi-img.com/b2c-shopapi-pms/pms_1656916095.89126677.png">
                    <div class="introduce_box_in_first">

                        Xiaomi 12S Ultra

                    </div>
                    <div class="introduce_box_in_second">
                        这真徕卡｜专业徕卡影像
                    </div>
                    <div class="introduce_box_in_thrid">
                        ￥4599
                    </div>
                </div>
                <div class="introduce_box_in">
                    <img src="https://cdn.cnbj0.fds.api.mi-img.com/b2c-shopapi-pms/pms_1640768539.98629966.jpg">
                    <div class="introduce_box_in_first">
                        小米平板 5 Pro
                    </div>
                    <div class="introduce_box_in_second">
                        大屏效率新体验
                    </div>
                    <div class="introduce_box_in_thrid">
                        ￥3000
                    </div>
                </div>
                <div class="introduce_box_in">
                    <img src="https://cdn.cnbj0.fds.api.mi-img.com/b2c-shopapi-pms/pms_1609158754.96998301.jpg">
                    <div class="introduce_box_in_first">

                        Redmi K50 至尊版

                    </div>
                    <div class="introduce_box_in_second">
                        骁龙8+ ｜1.5K 高清直屏
                    </div>
                    <div class="introduce_box_in_thrid">
                        ￥2999
                    </div>
                </div>
                <div class="introduce_box_in">
                    <img src="https://cdn.cnbj0.fds.api.mi-img.com/b2c-shopapi-pms/pms_1595400896.08014623.jpg">
                    <div class="introduce_box_in_first">
                        黑鲨5 Pro 8GB+256GB
                    </div>
                    <div class="introduce_box_in_second">
                        游戏手机
                    </div>
                    <div class="introduce_box_in_thrid">
                        ￥3499
                    </div>
                </div>
                <div class="introduce_box_in">
                    <img src="https://cdn.cnbj0.fds.api.mi-img.com/b2c-shopapi-pms/pms_1634108394.13125707.jpg">
                    <div class="introduce_box_in_first">
                        Redmi Note 11 Pro
                    </div>
                    <div class="introduce_box_in_second">
                        5160m Ah 超大电池
                    </div>
                    <div class="introduce_box_in_thrid">
                        ￥5000
                    </div>
                </div>
                <div class="introduce_box_in">
                    <img src="https://cdn.cnbj0.fds.api.mi-img.com/b2c-shopapi-pms/pms_1660117297.65685839.png">
                    <div class="introduce_box_in_first">
                        Redmi Note 11 Pro
                    </div>
                    <div class="introduce_box_in_second">
                        5160m Ah 超大电池
                    </div>
                    <div class="introduce_box_in_thrid">
                        ￥5000
                    </div>
                </div>
                <div class="introduce_box_in">
                    <img src="https://cdn.cnbj0.fds.api.mi-img.com/b2c-shopapi-pms/pms_1660187405.88555521.jpg">
                    <div class="introduce_box_in_first">

                        Xiaomi MIX Fold 2

                    </div>
                    <div class="introduce_box_in_second">
                        超轻薄折叠机身设计，小米自研微水滴形态转轴
                    </div>
                    <div class="introduce_box_in_thrid">
                        ￥8999
                    </div>
                </div>
                <div class="introduce_box_in">
                    <img src="https://cdn.cnbj0.fds.api.mi-img.com/b2c-shopapi-pms/pms_1632824968.20185994.png">
                    <div class="introduce_box_in_first">

                        Xiaomi真无线降噪耳机3

                    </div>
                    <div class="introduce_box_in_second">
                        40dB宽频主动降噪 | HiFi高保真音质 | HRTF专业调音
                    </div>
                    <div class="introduce_box_in_thrid">
                        ￥319
                    </div>
                </div>
                <div class="introduce_box_in">
                    <img src="https://cdn.cnbj0.fds.api.mi-img.com/b2c-shopapi-pms/pms_1640677355.02633044.png">
                    <div class="introduce_box_in_first">
                        XIAOMI Wwtch Color 2
                    </div>
                    <div class="introduce_box_in_second">
                        时刻出色，要你好看
                    </div>
                    <div class="introduce_box_in_thrid">
                        ￥2000
                    </div>
                </div>
                <div class="introduce_box_in">
                    <img src="https://cdn.cnbj0.fds.api.mi-img.com/b2c-shopapi-pms/pms_1656916095.89126677.png">
                    <div class="introduce_box_in_first">

                        Xiaomi 12S Ultra

                    </div>
                    <div class="introduce_box_in_second">
                        这真徕卡｜专业徕卡影像
                    </div>
                    <div class="introduce_box_in_thrid">
                        ￥4599
                    </div>
                </div>
                <div class="introduce_box_in">
                    <img src="https://cdn.cnbj0.fds.api.mi-img.com/b2c-shopapi-pms/pms_1640768539.98629966.jpg">
                    <div class="introduce_box_in_first">
                        小米平板 5 Pro
                    </div>
                    <div class="introduce_box_in_second">
                        大屏效率新体验
                    </div>
                    <div class="introduce_box_in_thrid">
                        ￥3000
                    </div>
                </div>
                <div class="introduce_box_in">
                    <img src="https://cdn.cnbj0.fds.api.mi-img.com/b2c-shopapi-pms/pms_1609158754.96998301.jpg">
                    <div class="introduce_box_in_first">

                        Redmi K50 至尊版

                    </div>
                    <div class="introduce_box_in_second">
                        骁龙8+ ｜1.5K 高清直屏
                    </div>
                    <div class="introduce_box_in_thrid">
                        ￥2999
                    </div>
                </div>
                <div class="introduce_box_in">
                    <img src="https://cdn.cnbj0.fds.api.mi-img.com/b2c-shopapi-pms/pms_1595400896.08014623.jpg">
                    <div class="introduce_box_in_first">
                        黑鲨5 Pro 8GB+256GB
                    </div>
                    <div class="introduce_box_in_second">
                        游戏手机
                    </div>
                    <div class="introduce_box_in_thrid">
                        ￥3499
                    </div>
                </div>
                <div class="introduce_box_in">
                    <img src="https://cdn.cnbj0.fds.api.mi-img.com/b2c-shopapi-pms/pms_1634108394.13125707.jpg">
                    <div class="introduce_box_in_first">
                        Redmi Note 11 Pro
                    </div>
                    <div class="introduce_box_in_second">
                        5160m Ah 超大电池
                    </div>
                    <div class="introduce_box_in_thrid">
                        ￥5000
                    </div>
                </div>
                <div class="introduce_box_in">
                    <img src="https://cdn.cnbj0.fds.api.mi-img.com/b2c-shopapi-pms/pms_1660117297.65685839.png">
                    <div class="introduce_box_in_first">
                        Redmi Note 11 Pro
                    </div>
                    <div class="introduce_box_in_second">
                        5160m Ah 超大电池
                    </div>
                    <div class="introduce_box_in_thrid">
                        ￥5000
                    </div>
                </div>
            </div>
        </div>
        <div class="allPrice">
            <div class="check">
                <input id="color_input_organ_all" type="checkbox" class="inputCheck">
                <label for="color_input_organ_all" class="color_input_organ_lable"></label>
                <p>全选</p>
            </div>
            <div class="accounts">
                <p>合计</p>
                <p class="account_price">4300</p>
                <div class="button">
                    <p>结算</p>
                </div>
            </div>
        </div>
        <div class="footer_guide">
            <div class="footer_guide_in footer_guide_home">
                <div class="footer_guide_in_top">
                    <img src="./Images/home2.png">
                </div>
                <div class="footer_guide_in_bottom">
                    首页
                </div>
            </div>
            <div class="footer_guide_in footer_guide_category">
                <div class="footer_guide_in_top">
                    <img src="./Images/categoey.png">
                </div>
                <div class="footer_guide_in_bottom">
                    分类
                </div>
            </div>
            <div class="footer_guide_in footer_guide_myself">
                <div class="footer_guide_in_top">
                    <img src="./Images/headImg1.jpg">
                </div>
                <div class="footer_guide_in_bottom">
                    我的
                </div>
            </div>
            <div class="footer_guide_in footer_guide_shopping">
                <div class="footer_guide_in_top">
                    <img src="./Images/shoppingCar.png">
                </div>
                <div class="footer_guide_in_bottom">
                    购物车
                </div>
            </div>
            <div class="footer_guide_in footer_guide_myself">
                <div class="footer_guide_in_top">
                    <img src="./Images/myself.png">
                </div>
                <div class="footer_guide_in_bottom">
                    暂定
                </div>
            </div>
        </div>
    </div>
</body>
<link rel="stylesheet" href="./css/Shopping.css">
<link rel="stylesheet" href="./css/All.css">
<script>
    var username = localStorage.getItem('username')
    var password = localStorage.getItem('password')
    var priceClass = document.getElementsByClassName('account_price')
    var price = priceClass[0].innerText
    let checkAll = document.querySelector('#color_input_organ_all')
    let checkOne = document.querySelector('#color_input_organ_one')
    let checkTwo = document.querySelector('#color_input_organ_two')
    if (checkOne.checked == false && checkTwo.checked == false) {
        priceClass[0].innerText = '0'
    } else if (checkOne.checked == true && checkTwo.checked == false) {
        priceClass[0].innerText = '3999'
    } else if (checkOne.checked == false && checkTwo.checked == true) {
        priceClass[0].innerText = '1837'
    } else {
        checkAll.checked = true
        priceClass[0].innerText = (2300 * Number(innerPrice[0].value)) + (2000 * Number(innerPrice[1].value))
    }

    if (username == '' && password == '') {
        location.href = './LoginBySecret.html'
    }

    var addShopping = document.querySelectorAll('.price_add')
    var deleteShopping = document.querySelectorAll('.price_delete')
    var innerPrice = document.querySelectorAll('.price_input')
    var lastPriceNumberOne = 1
    var lastPriceNumberTwo = 1
    for (var i = 0; i < addShopping.length; i++) {
        addShopping[i].addEventListener('click', function (e) {
            var isCalucateAll = checkAll.checked
            var isCalucateOne = checkOne.checked
            var isCalucateTwo = checkTwo.checked
            //eve_shopping_in_two_introduce_three_calucate
            var ident = this.parentNode.parentNode.parentNode.getAttribute('ident')
            if (isCalucateAll) {
                var indefincation = this.parentNode.parentNode.parentNode.parentNode.children[3].children[0].innerText
                var priceCurrent = Number(this.parentNode.parentNode.parentNode.children[0].innerText.split('￥')[1])
                var thisInput = this.parentNode.parentNode.children[1].children[0]
                var numberText = Number(thisInput.value)
                numberText++
                thisInput.value = new String(numberText)
                if (priceCurrent == 3999) {
                    priceClass[0].innerText = Number(priceClass[0].innerText) + (thisInput.value - lastPriceNumberOne) * priceCurrent
                    lastPriceNumberOne++
                } else {
                    priceClass[0].innerText = Number(priceClass[0].innerText) + (thisInput.value - lastPriceNumberTwo) * priceCurrent
                    lastPriceNumberTwo++
                }
            } else if (isCalucateOne == true && isCalucateTwo == false) {
                if (ident == '0') {
                    var indefincation = this.parentNode.parentNode.parentNode.parentNode.children[3].children[0].innerText
                    var priceCurrent = Number(this.parentNode.parentNode.parentNode.children[0].innerText.split('￥')[1])
                    var thisInput = this.parentNode.parentNode.children[1].children[0]
                    var numberText = Number(thisInput.value)
                    numberText++
                    thisInput.value = new String(numberText)
                    priceClass[0].innerText = Number(priceClass[0].innerText) + (thisInput.value - lastPriceNumberOne) * priceCurrent
                    lastPriceNumberOne++
                }

            } else if (isCalucateOne == false && isCalucateTwo == true) {
                if (ident == '1') {
                    var indefincation = this.parentNode.parentNode.parentNode.parentNode.children[3].children[0].innerText
                    var priceCurrent = Number(this.parentNode.parentNode.parentNode.children[0].innerText.split('￥')[1])
                    var thisInput = this.parentNode.parentNode.children[1].children[0]
                    var numberText = Number(thisInput.value)
                    numberText++
                    thisInput.value = new String(numberText)
                    priceClass[0].innerText = Number(priceClass[0].innerText) + (thisInput.value - lastPriceNumberTwo) * priceCurrent
                    lastPriceNumberTwo++
                }
            }

        })
    }
    for (var i = 0; i < innerPrice.length; i++) {
        innerPrice[i].addEventListener('input', function () {
            var differencePrice = Number(this.value) - lastPriceNumberOne
            var onePrice = this.parentNode.parentNode.parentNode.children[0].innerText.split('￥')[1]
            if (onePrice == '3999') {
                differencePrice = Number(this.value) - lastPriceNumberOne
            } else {
                differencePrice = Number(this.value) - lastPriceNumberTwo
            }
            var addPrice = Number(onePrice) * differencePrice
            if (addPrice > 0) {
                priceClass[0].innerText = addPrice + Number(priceClass[0].innerText)
            }
        })
    }
    for (var i = 0; i < addShopping.length; i++) {
        deleteShopping[i].addEventListener('click', function (e) {
            var isCalucateAll = checkAll.checked
            var isCalucateOne = checkOne.checked
            var isCalucateTwo = checkTwo.checked
            //eve_shopping_in_two_introduce_three_calucate
            var ident = this.parentNode.parentNode.parentNode.getAttribute('ident')
            var thisInput = this.parentNode.parentNode.children[1].children[0]
            var numberText = Number(thisInput.value)
            if(numberText>1){
            if (isCalucateAll) {
                var indefincation = this.parentNode.parentNode.parentNode.parentNode.children[3].children[0].innerText
                var priceCurrent = Number(this.parentNode.parentNode.parentNode.children[0].innerText.split('￥')[1])
                    numberText--
                thisInput.value = new String(numberText)
                if (priceCurrent == 3999) {
                    priceClass[0].innerText = Number(priceClass[0].innerText) -3999
                    lastPriceNumberOne--
                } else {
                    priceClass[0].innerText = Number(priceClass[0].innerText) -1837
                    lastPriceNumberTwo--
                }
            } else if (isCalucateOne == true && isCalucateTwo == false) {
                if (ident == '0') {
                    var indefincation = this.parentNode.parentNode.parentNode.parentNode.children[3].children[0].innerText
                    var priceCurrent = Number(this.parentNode.parentNode.parentNode.children[0].innerText.split('￥')[1])
                    var thisInput = this.parentNode.parentNode.children[1].children[0]
                    var numberText = Number(thisInput.value)
                    numberText--
                    thisInput.value = new String(numberText)
                    priceClass[0].innerText = Number(priceClass[0].innerText) -3999
                    lastPriceNumberOne--
                }

            } else if (isCalucateOne == false && isCalucateTwo == true) {
                if (ident == '1') {
                    var indefincation = this.parentNode.parentNode.parentNode.parentNode.children[3].children[0].innerText
                    var priceCurrent = Number(this.parentNode.parentNode.parentNode.children[0].innerText.split('￥')[1])
                    var thisInput = this.parentNode.parentNode.children[1].children[0]
                    var numberText = Number(thisInput.value)
                    numberText--
                    thisInput.value = new String(numberText)
                    priceClass[0].innerText = Number(priceClass[0].innerText) -1837
                    lastPriceNumberTwo--
                }
            }
        }
        })
    }
    var pathName = window.location.pathname
    var footerAll = document.querySelectorAll('.footer_guide_in_top')
    if (pathName.includes('Index')) {
        var indexImg = './Images/replaceIndex.png'
        var index = './Images/home2.png'
        changeImgAndText(footerAll[0], indexImg, index)

    } else if (pathName.includes('Category')) {
        var categoryImg = './Images/replaceCategory.png'
        var category = './Images/categoey.png'
        changeImgAndText(footerAll[1], categoryImg, category)
    } else if (pathName.includes('Shopping')) {
        var shoppingImg = './Images/replaceShopping.png'
        var shopping = './Images/shoppingCar.png'
        changeImgAndText(footerAll[3], shoppingImg, shopping)
    }

    function changeImgAndText(element, replaceImg, orginImg) {
        var currentImg = element.children[0].src
        if (currentImg.includes('replace')) {
            element.children[0].src = orginImg
            element.nextSibling.nextSibling.style.color = 'black'
        } else {
            element.children[0].src = replaceImg
            element.nextSibling.nextSibling.style.color = 'orangered'
        }
    }
    checkOne.addEventListener('click', function () {
        if(checkOne.checked==false){
            checkAll.checked=false
        }
        if (checkOne.checked == false && checkTwo.checked == false) {
            priceClass[0].innerText = '0'
        } else if (checkOne.checked == true && checkTwo.checked == false) {

            priceClass[0].innerText = 3999 * Number(innerPrice[0].value)
        } else if (checkOne.checked == false && checkTwo.checked == true) {
            priceClass[0].innerText = 1837 * Number(innerPrice[1].value)
        } else {
            checkAll.checked = true
            priceClass[0].innerText = (3999 * Number(innerPrice[0].value)) + (1837 * Number(innerPrice[1].value))
        }
        if (checkOne.checked == false) {
        } else {
        }
    })
    checkTwo.addEventListener('click', function () {
        if(checkTwo.checked==false){
            checkAll.checked=false
        }
        if (checkOne.checked == false && checkTwo.checked == false) {
            priceClass[0].innerText = '0'
        } else if (checkOne.checked == true && checkTwo.checked == false) {

            priceClass[0].innerText = 3999 * Number(innerPrice[0].value)
        } else if (checkOne.checked == false && checkTwo.checked == true) {
            priceClass[0].innerText = 1837 * Number(innerPrice[1].value)
        } else {
            checkAll.checked = true
            priceClass[0].innerText = (3999 * Number(innerPrice[0].value)) + (1837 * Number(innerPrice[1].value))
        }
        if (checkOne.checked == false) {
        } else {
        }
    })
    if (checkOne.checked == false && checkTwo.checked == false) {
        priceClass[0].innerText = '0'
    } else if (checkOne.checked == true && checkTwo.checked == false) {

        priceClass[0].innerText = 2300 * Number(innerPrice[0].value)
    } else if (checkOne.checked == false && checkTwo.checked == true) {
        priceClass[0].innerText = 2000 * Number(innerPrice[1].value)
    } else {
        checkAll.checked = true
        priceClass[0].innerText = (2300 * Number(innerPrice[0].value)) + (2000 * Number(innerPrice[1].value))
    }
    checkAll.addEventListener('click', function () {
        let price=document.querySelectorAll('.calucate_rewrite_two')
        if (checkOne.checked == true && checkTwo.checked == true) {
            priceClass[0].innerText = '0'
        } else if (checkOne.checked == true && checkTwo.checked == false) {
            priceClass[0].innerText = Number(price[0].children[0].value)*3999
        } else if (checkOne.checked == false && checkTwo.checked == true) {
            priceClass[0].innerText =  Number(price[1].children[0].value)*1837
        } else {
            checkAll.checked = true
            priceClass[0].innerText = Number(price[0].children[0].value)*3999+Number(price[1].children[0].value)*1837
        }
        if (checkAll.checked) {
            checkOne.checked = true
            checkTwo.checked = true
        } else {
            checkOne.checked = false
            checkTwo.checked = false
        }
    })
</script>

</html>